package com.wego.service.impl;

import com.github.pagehelper.Page;
import com.wego.common.base.impl.BaseServiceImpl;
import com.wego.common.bean.PageBean;
import com.wego.entity.domain.Announcement;
import com.wego.entity.query.AnnouncementQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wego.mapper.AnnouncementMapper;
import com.wego.service.AnnouncementService;
@Service
public class AnnouncementServiceImpl extends BaseServiceImpl<Announcement> implements AnnouncementService {

    @Autowired
    private AnnouncementMapper announcementMapper;

    @Override
    public PageBean<Announcement> selectPage(AnnouncementQuery announcementQuery) {
        //设置分页信息
        Page<Announcement> page = announcementQuery.toPage();
        //查询数据
        announcementMapper.selectList(announcementQuery);
        //将MyBatis提供的Page对象转换成我们自己的PageBean对象
        return new PageBean<>(page);
    }



}
